class Solution {
public:
    vector<int> findPeaks(vector<int>& nums)
    {
        int n = nums.size();
        vector<int> ans;
        for (int i = 1; i < n - 1; i++)
        {
            int j = i - 1;
            int k = i + 1;
            if (nums[i] > nums[j] && nums[i] > nums[k]) ans.push_back(i);
        }
        return ans;
    }
};